<?php
/**
 * description
 *
 * @copyright        2016 opencart.cn - All Rights Reserved
 * @link             http://www.guangdawangluo.com
 * @author           TL <mengwb@opencart.cn>
 * @created          2016-11-08 15:25:00
 * @modified         2016-11-08 12:25:00
 */

class ModelReportSaleGd extends Model
{
    public function getTotalOrdersByZone()
    {
        $query = $this->db->query('SELECT COUNT(*) AS total, SUM(o.total) AS amount, c.code FROM `'.DB_PREFIX.'order` o LEFT JOIN `'.DB_PREFIX."zone` c ON (o.shipping_zone_id = c.zone_id) WHERE o.order_status_id > '0' GROUP BY o.shipping_zone_id");

        return $query->rows;
    }
}
